package tech.aistar.mapper;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tech.aistar.entity.Completion;

import java.util.List;

@Repository
public interface CompletionMapper {

    @Select("select com_stem  from completion")
    List<String> findcomstem();

    @Select("select com_language from completion")
    List<String> findcomlanguage();

    @Select("select * from completion")
    List<Completion> findAll();

    @Select("select com_answer from  completion  where com_stem ='${stem}'")
    String findstemans(String stem);

    @Select("select com_diff from completion")
    List<String> finddiff();

    @Select("select * from completion where com_id = #{value}")
    Completion findById(Long id);

    @Select("select c.com_id, c.com_stem from completion c  join questionpaper q on c.com_id = q.que_id where q.paper_id = #{value}  and que_type =3")
    List<Completion> findByPaperId(Long paperId);

    @Select("select com_answer from completion where com_id = #{value}")
    String findAnswerByid(Long id);



}
